cmake_minimum_required(VERSION 3.20)
project(CMakeDemo_i18N)

# 设置通用cmake
set( common_root ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

set( common_output_root ${CMAKE_CURRENT_SOURCE_DIR})

# 第三方库路径
set(third_party_root ${CMAKE_CURRENT_SOURCE_DIR}/ext)

# 加载common 中的 cmake 脚本设置
set(common_cmake         ${common_root}/common.cmake)
include(${common_cmake})

# 引用通用文件源码
include(${CMAKE_CURRENT_SOURCE_DIR}/ProjectCommon/project_common.cmake)


# 1. 打开允许创建文件夹的开关
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# option 
option(demo_widget_enabled "demo_widget PROJECT IS ENABLED" ON)

# 主工程
if (demo_widget_enabled)
        add_subdirectory("DemoWidget")
endif(demo_widget_enabled)

# 配置工具
# todo

# 2. 把工程加到文件夹中
# set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "CMakeTargets")
# 3. 给 cmake 自动创建的工程重新命名, 默认名为 "CMakePredefinedTargets" 
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets")
